#ifndef DIALOG_CONFIGSYSTERMPARAS_H
#define DIALOG_CONFIGSYSTERMPARAS_H

#include <QDialog>
#include <QSettings>
#include "inimanager.h"

namespace Ui {
class Dialog_configSystermParas;
}

class Dialog_configSystermParas : public QDialog
{
    Q_OBJECT

public:
    explicit Dialog_configSystermParas(QWidget *parent = nullptr);
    ~Dialog_configSystermParas();
    void writeIni();
    void readIni();
    void initIniManager();

    QString removePrefix(const QString &str, const QString &prefix);
    void readSystemData();
public slots:
//    void do_TextChanged(const QString &text);
private slots:
    void on_btn_save_clicked();

    void on_btn_cancel_clicked();

    void on_btn_seletFilePath_clicked();

private:
    Ui::Dialog_configSystermParas *ui;

    const QString m_prefix = "\\\\.\\";

    iniManager *m_iniManager = nullptr;
private:
    QVariantMap getConfigMap();
    QVariantMap getLineEditConfigMap();

    void setLineEditConfigMap(const QVariantMap &map_config);
    void LineEditAllClear();

    void readTimeData();
    void readCsvFilePath();
    void saveTimeConfig();

    void saveIPConfig();
    void saveCsvConfig();
    void saveSystemConfig();
};

#endif // DIALOG_CONFIGSYSTERMPARAS_H
